home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DEMOS / SEA_CODE.ZIP / VCHSIZEA.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-10-07  |  43.7 KB  |  1,389 lines

  1.         dosseg
  2.         .286
  3.         Locals
  4.  
  5.         MWAIT equ 080h
  6.         CLEARLINE EQU 185
  7.  
  8. stacks  segment byte stack 'stack'
  9.   thestak      db      256 dup (0)
  10. stacks  ends
  11.  
  12. data    segment para public 'data'
  13.         Font05          db      18819 dup (0)
  14.         vla2cmp         db      10735 dup (0)
  15. data    ends
  16.  
  17. code    segment byte public 'code'
  18.            assume  cs:code, ds:code, es:code, ss:stacks
  19.         
  20. start:  
  21.         cli
  22.         mov     bx,seg stacks
  23.         mov     ss,bx
  24.         mov     sp,200h
  25.         sti
  26.         mov     ax,es           ;set up all the segs
  27.         mov     cs:[dseg],ax
  28.         add     bx,20h
  29.         mov     cs:[backupseg],bx
  30.         add     bx,4000
  31.         mov     cS:[overlayseg],bx
  32.         add     bx,600*2
  33.         mov     cs:[textseg],bx
  34.         add     bx,600*2
  35.         mov     cs:[textoverlayseg],bx
  36.         
  37.         jmp    main
  38.         
  39. ;======- DATA -======
  40.  
  41.         Instruct db     "                                  ",13,10      
  42.                 db      "  KEYS:  +/- Change scroll speed  ",13,10
  43.                 db      "         [SPACE] Hurry scroll     ",13,10
  44.                 db      "         [ENTER] Next message     ",13,10
  45.                 db      "                                  ",13,10
  46.                 DB      "         1-4 Set Detail Level     ",13,10
  47.                 db      "                                  ",13,10      
  48.                 db      " This version should work better. ",13,10      
  49.                 db      "                                  ",13,10,0,"$"
  50.  
  51.         CENTERX equ     160
  52.         CENTERY equ     100
  53.  
  54.         MESSAGEWIDTH equ 25
  55.  
  56.         Numtextlines EQU 8
  57.         CmpValue db     10
  58.         CurTextline dw  1
  59.         curtextlineoffset dw offset textlines2+2
  60.         Textlinesoffset dw offset textlines1,offset textlines2,offset textlines3
  61.                 dw      offset textlines4,offset textlines5,offset textlines6
  62.                 dw      offset textlines7,OFFSET TEXTLINES8
  63.         setvalue db 20
  64.  
  65.         textlines1 db   20,5            ;number of lines, line to change msg
  66.                 db      1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  67.                 db      0,1,2,3,4,5,6,8,9,10,11,12,14,15,16,17,18,19, 0
  68.                 db      0,0,0,2,3,4,5,7,8,10,11,13,14,16,17,19, 0, 0, 0
  69.                 db      0,0,0,0,0,0,2,5,7,10,13,16,19, 0, 0, 0, 0, 0, 0
  70.                 db      0,0,0,0,0,0,0,0,3,10,16, 0, 0, 0, 0, 0, 0, 0, 0
  71.                 db      0,0,0,0,0,0,0,0,0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0
  72.                 db      0,0,0,0,0,0,0,0,16,10,3, 0, 0, 0, 0, 0, 0, 0, 0
  73.                 db      0,0,0,0,0,0,19,16,13,10,7,5,2, 0, 0, 0, 0, 0, 0
  74.                 db      0,0,0,19,17,16,14,13,11,10,8,7,6,5,4,3, 0, 0, 0
  75.                 db      0,19,18,17,16,15,14,12,11,10,9,8,6,5,4,3,2,1, 0
  76.                 db      19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1
  77.                 db      0,19,18,17,16,15,14,12,11,10,9,8,6,5,4,3,2,1, 0
  78.                 db      0,0,0,19,17,16,14,13,11,10,8,7,6,5,4,3, 0, 0, 0
  79.                 db      0,0,0,0,0,0,19,16,13,10,7,5,2, 0, 0, 0, 0, 0, 0
  80.                 db      0,0,0,0,0,0,0,0,16,10,3, 0, 0, 0, 0, 0, 0, 0, 0
  81.                 db      0,0,0,0,0,0,0,0,0,9,0, 0, 0, 0, 0, 0, 0, 0, 0
  82.                 db      0,0,0,0,0,0,0,0,3,10,16, 0, 0, 0, 0, 0, 0, 0, 0
  83.                 db      0,0,0,0,0,0,2,5,7,10,13,16,19, 0, 0, 0, 0, 0, 0
  84.                 db      0,0,0,2,3,4,5,7,8,10,11,13,14,16,17,19, 0, 0, 0
  85.                 db      0,1,2,3,4,5,6,8,9,10,11,12,14,15,16,17,18,19, 0
  86.         Textlines2 db   20,10
  87.                 db      1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  88.                 db      1,2,3,4,5,6,7,8,9, 0,11,12,13,14,15,16,17,18,19
  89.                 db      1,2,3,4,5,6,7,8,0, 0, 0,12,13,14,15,16,17,18,19
  90.                 db      1,2,3,4,5,6,7,0,0, 0, 0, 0,13,14,15,16,17,18,19
  91.                 db      1,2,3,4,5,6,7 dup (0),14,15,16,17,18,19
  92.                 db      1,2,3,4,5,9 dup (0),15,16,17,18,19
  93.                 db      1,2,3,4,11 dup (0),16,17,18,19
  94.                 db      1,2,3,13 dup (0),17,18,19
  95.                 db      1,2,15 dup(0),18,19
  96.                 db      1,17 dup (0),19
  97.                 db      19 dup (0)
  98.                 db      1,17 dup (0),19
  99.                 db      1,2,15 dup(0),18,19
  100.                 db      1,2,3,13 dup (0),17,18,19
  101.                 db      1,2,3,4,11 dup (0),16,17,18,19
  102.                 db      1,2,3,4,5,9 dup (0),15,16,17,18,19
  103.                 db      1,2,3,4,5,6,7 dup (0),14,15,16,17,18,19
  104.                 db      1,2,3,4,5,6,7,0,0, 0, 0, 0,13,14,15,16,17,18,19
  105.                 db      1,2,3,4,5,6,7,8,0, 0, 0,12,13,14,15,16,17,18,19
  106.                 db      1,2,3,4,5,6,7,8,9, 0,11,12,13,14,15,16,17,18,19
  107.         Textlines3 db   20,10
  108.                 db      1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  109.                 db      0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19
  110.                 db      0,0,1,2,3,4,5,6,7,8,12,13,14,15,16,17,18,19,0
  111.                 db      0,0,0,1,2,3,4,5,6,7,13,14,15,16,17,18,19,0,0
  112.                 db      0,0,0,0,1,2,3,4,5,6,14,15,16,17,18,19,3 dup (0)
  113.                 db      5 dup (0),1,2,3,4,5,15,16,17,18,19,4 dup (0)
  114.                 db      6 dup (0),1,2,3,4,16,17,18,19,5 dup (0)
  115.                 db      7 dup (0),1,2,3,17,18,19,6 dup (0)
  116.                 db      8 dup (0),1,2,18,19,7 dup (0)
  117.                 db      9 dup (0),1,19,8 dup (0)
  118.                 db      19 dup (0)
  119.                 db      9 dup (0),1,19,8 dup (0)
  120.                 db      8 dup (0),1,2,18,19,7 dup (0)
  121.                 db      7 dup (0),1,2,3,17,18,19,6 dup (0)
  122.                 db      6 dup (0),1,2,3,4,16,17,18,19,5 dup (0)
  123.                 db      5 dup (0),1,2,3,4,5,15,16,17,18,19,4 dup (0)
  124.                 db      0,0,0,0,1,2,3,4,5,6,14,15,16,17,18,19,3 dup (0)
  125.                 db      0,0,0,1,2,3,4,5,6,7,13,14,15,16,17,18,19,0,0
  126.                 db      0,0,1,2,3,4,5,6,7,8,12,13,14,15,16,17,18,19,0
  127.                 db      0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19
  128.         Textlines4 db   20,10
  129.                 db      1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  130.                 db      5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14
  131.                 db      7,7,7,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13
  132.                 db      8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12
  133.                 db      8,8,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11,12,12
  134.                 db      9,9,9,9,9,9,10,10,10,10,10,10,11,11,11,11,11,11,12
  135.                 db      9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11
  136.                 db      9,9,0,9,9,0,10,10, 0,10,10, 0,10,11,00,11,11,00,11
  137.                 db      9,0,0,0,9,0,10,00, 0,00,10,00,10,00,00,00,11,00,11
  138.                 db      0,0,0,0,9,0,00,00,00,00,10,00,00,00,00,00,11,00,00
  139.                 db      19 dup (0)
  140.                 db      0,0,0,0,9,0,00,00,00,00,10,00,00,00,00,00,11,00,00
  141.                 db      9,0,0,0,9,0,10,00, 0,00,10,00,10,00,00,00,11,00,11
  142.                 db      9,9,0,9,9,0,10,10, 0,10,10, 0,10,11,00,11,11,00,11
  143.                 db      9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11
  144.                 db      9,9,9,9,9,9,10,10,10,10,10,10,11,11,11,11,11,11,12
  145.                 db      8,8,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11,12,12
  146.                 db      8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12
  147.                 db      7,7,7,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13
  148.                 db      5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14
  149.         Textlines5 db   40,20
  150.                 db      1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  151.                 db      0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  152.                 db      0,2,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  153.                 db      0,0,3,2,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  154.                 db      0,0,0,4,3,2,1,8,9,10,11,12,13,14,15,16,17,18,19
  155.                 db      0,0,0,0,5,4,3,2,1,10,11,12,13,14,15,16,17,18,19
  156.                 db      0,0,0,0,0,6,5,4,3, 2, 1,12,13,14,15,16,17,18,19
  157.                 db      0,0,0,0,0,0,7,6,5, 4, 3, 2, 1,14,15,16,17,18,19
  158.                 db      0,0,0,0,0,0,0,8,7, 6, 5, 4, 3, 2, 1,16,17,18,19
  159.                 db      0,0,0,0,0,0,0,0,9, 8, 7, 6, 5, 4, 3, 2, 1,18,19
  160.                 db      0,0,0,0,0,0,0,0,0,10, 9, 8, 7, 6, 5, 4, 3, 2, 1
  161.                 db      0,0,0,0,0,0,0,0,0, 0,11,10, 9, 8, 7, 6, 5, 4, 3
  162.                 db      0,0,0,0,0,0,0,0,0, 0, 0,12,11,10, 9, 8, 7, 6, 5
  163.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0,13,12,11,10, 9, 8, 7
  164.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0,14,13,12,11,10, 9
  165.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0,15,14,13,12,11
  166.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0,16,15,14,13
  167.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0,17,16,15
  168.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,18,17
  169.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0,19                
  170.                 DB      19 dup (0)
  171.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0,19
  172.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0,18,17
  173.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0,17,16,15
  174.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0,16,15,14,13
  175.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0,15,14,13,12,11
  176.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0, 0,14,13,12,11,10, 9
  177.                 db      0,0,0,0,0,0,0,0,0, 0, 0, 0,13,12,11,10, 9, 8, 7
  178.                 db      0,0,0,0,0,0,0,0,0, 0, 0,12,11,10, 9, 8, 7, 6, 5
  179.                 db      0,0,0,0,0,0,0,0,0, 0,11,10, 9, 8, 7, 6, 5, 4, 3
  180.                 db      0,0,0,0,0,0,0,0,0,10, 9, 8, 7, 6, 5, 4, 3, 2, 1
  181.                 db      0,0,0,0,0,0,0,0,9, 8, 7, 6, 5, 4, 3, 2, 1,18,19
  182.                 db      0,0,0,0,0,0,0,8,7, 6, 5, 4, 3, 2, 1,16,17,18,19
  183.                 db      0,0,0,0,0,0,7,6,5, 4, 3, 2, 1,14,15,16,17,18,19
  184.                 db      0,0,0,0,0,6,5,4,3, 2, 1,12,13,14,15,16,17,18,19
  185.                 db      0,0,0,0,5,4,3,2,1,10,11,12,13,14,15,16,17,18,19
  186.                 db      0,0,0,4,3,2,1,8,9,10,11,12,13,14,15,16,17,18,19
  187.                 db      0,0,3,2,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  188.                 db      0,2,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  189.                 db      0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  190.         Textlines6 db   10,5
  191.                 db      1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  192.                 db      1,2,3,0,5,6,7,8,0,10,11,12,13,00,15,16,17,18,00
  193.                 db      1,2,0,0,5,6,7,0,0,10,11,12,00,00,15,16,17,00,00
  194.                 db      1,0,0,0,5,6,0,0,0,10,11,00,00,00,15,16,00,00,00
  195.                 db      0,0,0,0,5,0,0,0,0,10,00,00,00,00,15,00,00,00,00
  196.                 DB      19 dup (0)
  197.                 db      0,0,0,0,5,0,0,0,0,10,00,00,00,00,15,00,00,00,00
  198.                 db      1,0,0,0,5,6,0,0,0,10,11,00,00,00,15,16,00,00,00
  199.                 db      1,2,0,0,5,6,7,0,0,10,11,12,00,00,15,16,17,00,00
  200.                 db      1,2,3,0,5,6,7,8,0,10,11,12,13,00,15,16,17,18,00
  201.         Textlines7 db   39,20
  202.                 db      1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  203.                 db      2,4,5,6,7,8,9,9,10,10,11,11,12,13,14,15,16,17,19
  204.                 db       2, 5, 7, 8, 8, 9, 9, 9,10,10,10,11,11,11,12,12,13,15,18
  205.                 db       3, 6, 8, 9, 9,10,10,10,11,11,11,12,12,12,13,13,14,16,19
  206.                 db       4, 7, 9,10,10,11,11,11,12,12,12,13,13,13,14,14,15,17,0
  207.                 db       5, 8,10,11,11,12,12,12,13,13,13,14,14,14,15,15,16,18,0
  208.                 db       6, 9,11,12,12,13,13,13,14,14,14,15,15,15,16,16,17,19,0
  209.                 db       7,10,12,13,13,14,14,14,15,15,15,16,16,16,17,17,18, 0,0
  210.                 db       8,11,13,14,14,15,15,15,16,16,16,17,17,17,18,18,19, 0,0
  211.                 db       9,12,14,15,15,16,16,16,17,17,17,18,18,18,19,19, 0, 0,0
  212.                 db      10,13,15,16,16,17,17,17,18,18,18,19,19,19,5 dup (0)
  213.                 db      11,14,16,17,17,18,18,18,19,19,19,8 dup (0)
  214.                 db      12,15,17,18,18,19,13 dup (0)
  215.                 db      13,16,18,19,19,14 dup (0)
  216.                 db      14,17,19,16 dup (0)
  217.                 db      15,18,17 dup (0)
  218.                 db      16,19,17 dup (0)
  219.                 db      17,18 dup (0)
  220.                 db      18,18 dup (0)
  221.                 db      19,18 dup (0)
  222.                 db      19 dup (0)
  223.                 db      19,18 dup (0)
  224.                 db      18,18 dup (0)
  225.                 db      17,18 dup (0)
  226.                 db      16,19,17 dup (0)
  227.                 db      15,18,17 dup (0)
  228.                 db      14,17,19,16 dup (0)
  229.                 db      13,16,18,19,19,14 dup (0)
  230.                 db      12,15,17,18,18,19,13 dup (0)
  231.                 db      11,14,16,17,17,18,18,18,19,19,19,8 dup (0)
  232.                 db      10,13,15,16,16,17,17,17,18,18,18,19,19,19,5 dup (0)
  233.                 db       9,12,14,15,15,16,16,16,17,17,17,18,18,18,19,19, 0, 0,0
  234.                 db       8,11,13,14,14,15,15,15,16,16,16,17,17,17,18,18,19, 0,0
  235.                 db       7,10,12,13,13,14,14,14,15,15,15,16,16,16,17,17,18, 0,0
  236.                 db       6, 9,11,12,12,13,13,13,14,14,14,15,15,15,16,16,17,19,0
  237.                 db       5, 8,10,11,11,12,12,12,13,13,13,14,14,14,15,15,16,18,0
  238.                 db       4, 7, 9,10,10,11,11,11,12,12,12,13,13,13,14,14,15,17,0
  239.                 db       3, 6, 8, 9, 9,10,10,10,11,11,11,12,12,12,13,13,14,16,19
  240.                 db       2, 5, 7, 8, 8, 9, 9, 9,10,10,10,11,11,11,12,12,13,15,18
  241.                 db      2,4,5,6,7,8,9,9,10,10,11,11,12,13,14,15,16,17,19
  242.         Textlines8 db   20,10
  243.                 db      1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  244.                 DB      0,2,3,4,5,6,7,8,9,10, 0,12,13,14,15,16,17,18,19
  245.                 DB      0,2,3,4,5,6,7,0,9,10, 0,12,13,14, 0,16,17,18,19
  246.                 DB      0,2,3,0,5,6,7,0,9,10, 0,12,13,14, 0,16, 0,18,19
  247.                 DB      0,2,3,0,5,0,7,0,9,10, 0,12, 0,14, 0,16, 0,18,19
  248.                 DB      0,2,0,0,5,0,7,0,9,10, 0,12, 0,14, 0,16, 0,18, 0
  249.                 DB      0,2,0,0,5,0,7,0,9, 0, 0,12, 0,14, 0, 0, 0,18, 0
  250.                 DB      0,2,0,0,5,0,0,0,9, 0, 0, 0, 0,14, 0, 0, 0,18, 0
  251.                 DB      0,0,0,0,5,0,0,0,9,0,0,0,0,14,0,0,0,0,0
  252.                 DB      0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0
  253.                 DB      19 DUP (0)
  254.                 db      1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0
  255.                 db      1,0,3,0,0,0,0,0,0,0,11,0,0,0,0,16,0,0,0
  256.                 db      1,0,3,0,0,0,7,0,0,0,11,0,0,0,0,16,0,18,0
  257.                 db      1,0,3,0,0,0,7,8,0,0,11,0,13,0,0,16,0,18,0
  258.                 db      1,0,3,0,0,0,7,8,0,10,11,0,13,0,0,16,0,18,19
  259.                 db      1,0,3,0,5,0,7,8,0,10,11,0,13,14,0,16,0,18,19
  260.                 db      1,0,3,4,5,0,7,8,9,10,11,0,13,14,0,16,0,18,19
  261.                 db      1,2,3,4,5,0,7,8,9,10,11,0,13,14,15,16,0,18,19
  262.                 db      1,2,3,4,5,0,7,8,9,10,11,12,13,14,15,16,17,18,19
  263.                 
  264.         dseg    dw      0
  265.         vgaseg  dw      0a000h
  266.         backupseg dw    0
  267.         overlayseg dw   0
  268.         Textseg dw      0
  269.         Textoverlayseg dw       0        
  270.         
  271.         Specialtextflag db 0
  272.  
  273.         Xsize dw        250
  274.         Ysize   dw      105
  275.         
  276.         ByteValue dw    0
  277.         Resultstring db "00000"
  278.         resultstringend db "$"
  279.  
  280.         Header  db      "VGACHR"
  281.         Sizex   db      18
  282.         Sizey   db      19
  283.         Numchars db     66
  284.  
  285.         Fadestep db     0
  286.         Distance dw     110h+10
  287.         opDist  dw      110h+10
  288.         Velocity dw     9
  289.         Acceleration dw 1
  290.  
  291.         RightSide db    0
  292.  
  293.         XYsize  dw      18*19
  294.         pal     db      768 dup (0)
  295.         PALTMP  DB      768 DUP (0)
  296.         palstep  db     768 dup (0)
  297.         palstep2 db     768 dup (0)
  298.         redstep db      80*3 dup (0)
  299.         redstep2 db     80*3 dup (0)
  300.         redbluepal  db  80*3 dup (0)
  301.  
  302.         Count   dw      1
  303.         CharCount db    1
  304.  
  305.         Xstart  dw      -145
  306.         ScrollCOunt db  1
  307.         ScrollSpeed db  4
  308.  
  309.         MSGPAUSE        DW      10
  310.  
  311.         ErrorMessage db "File Error.  Program Aborted.",13,10,"$"
  312.  
  313.                         ; 1 IS CHANGE COLOR TO NEXT BYTE
  314.         TextMsg2 db     (320-15*18)/2,1,0,"CODED ",1,24,"BY @",1,8,"DRAEDEN",1,24,"@ ",1,0,0
  315.         
  316.                 ;1 IS COLOR - 0 IS END OF MESSAGE
  317.                 ;21 CHARS EACH MSG or less!
  318.  
  319.         Msg1    db      (320-15* 9)/2,1, 32,"@ V L A @       ",0
  320.         MSG2    DB      (320-15* 9)/2,1,136,"P",1,128,"R",1,136,"E",1,128,"S",1,136,"E",1,128,"N",1,136,"T",1,128,"S",1,136,":",0
  321.         MSG3    DB      (320-15*11)/2,1, 48,"-",1,32," SEASICK",1,48," -",0
  322.         MSG4    DB      (320-15*17)/2,1, 40,"@ ",1,32,"*",1,40," @",1,32," *",1,40," @",1,32," *",1,40," @ ",1,32,"* ",1,40,"@",0
  323.         MSG5    DB      (320-15*20)/2,1, 32,"CURRENT MEMBERS ARE:",0
  324.         MSG6    DB      (320-15*20)/2,1, 32,"DRAEDEN ",1,40,"@",1,48," MAIN CODER",0
  325.         MSG61   DB      (320-15*10)/2,1, 48,"AND ARTIST",0
  326.         MSG7    DB      (320-15*19)/2,1, 40,"THE KABAL",1,32," @",1,48," ARTIST?",0
  327.         MSG8    DB      (320-15*17)/2,1, 48,"LITHIUM ",1,32,"*",1,40," PERHAPS",0
  328.         MSG9    DB      (320-15*15)/2,1, 40,"ALSO AN ARTIST?",0
  329.         MSG10   DB      (320-15*21)/2,1, 32,"OR MAYBE COORDINATOR?",0
  330.         MSG13   DB      (320-15*19)/2,1, 48,"$ UNTIL NEXT TIME $",0
  331.         MSG14   DB      (320-15*20)/2,1,128,"REMEMBER:",1,8," THE GNAT..",0
  332.         MSG15   DB      (320-15*19)/2,1, 32,"ALWAYS FLIES EAST..",0
  333.         MSG16   DB      (320-15*12)/2,1, 48,"WHEN IN HEAT",0
  334.         MSG17   DB      (320-15*12)/2,1, 40,"OR SOMETHING",0 
  335.         MSG18   DB      (320-15*10)/2,1, 32,"LIKE THAT?",0
  336.         MSG19   DB      (320-15*17)/2,1,128,"*",1,136,"@",1,8," BYE FOR NOW",1,136," @",1,128,"*",0
  337.         MSG20   DB      (320-15* 3)/2,1,128," ",0
  338.         MSG21   DB      (320-15*12)/2,1, 32,"IT'S OVER...",0
  339.         MSG22   DB      (320-15* 8)/2,1, 40,"GO AWAY",1,128,"!",0
  340.                                           
  341.  
  342.         MSGOFFSETS Dw   OFFSET MSG1,OFFSET MSG2,OFFSET MSG3,OFFSET TEXTMSG2
  343.                 DW      OFFSET MSG4,OFFSET MSG5,OFFSET MSG6,OFFSET MSG61,OFFSET MSG7
  344.                 DW      OFFSET MSG8,OFFSET MSG9,OFFSET MSG10
  345.                 DW      OFFSET MSG13,OFFSET MSG14,OFFSET MSG15
  346.                 DW      OFFSET MSG16,OFFSET MSG17,OFFSET MSG18,OFFSET MSG19
  347.                 DW      OFFSET MSG20,OFFSET MSG20,OFFSET MSG21,OFFSET MSG22
  348.                 DW      OFFSET MSG20,OFFSET MSG20,OFFSET MSG22,OFFSET TEXTMSG2
  349.         NUMMSG  DB      27
  350.         msgcount db     0
  351.  
  352.         TextLength       db 0
  353.         Letstart dw      0
  354.         printIt db      0
  355.         cOLOR   DB      0
  356.                                                
  357.         CAPSCOLOR equ 0
  358.         LOWERCOLOR equ 128
  359.                                                 ;
  360.         TextMsg db      "                      ",34,"SEASICK",34,"    BY *draeden* OF vla..."
  361.                 DB      " OUR LITTE GROUP IS STILL IN NEED OF A COUPLE MORE ASSEMBLER CODERS,"
  362.                 DB      " ARTIST OR SOMEONE WHO WOULD KNOW HOW TO GET MUSIC TO WORK... "
  363.                 DB      " WE'RE STILL WORKING ON A FEW MORE LOADER TRYING DIFFERENT STUFF "
  364.                 DB      "LIKE A SCROLL THAT APPEARS TO BE 3D - SORT OF LIKE I HAVE HERE... "
  365.                 DB      "LOOK FOR IT IN ABOUT A MONTH... BY THEN WE'LL PROBABLY HAVE SOUND FOR THESE THINGS.   "
  366.                 db      " OH, YEAH A mega THANKS TO *thg* FOR THIS FONT! "
  367.                 DB      " AND I'VE REVISED MY FADER ROUTINES * CHECK IT OUT * "
  368.                 DB      " NOTICE HOW THE COLORS KEEP THEIR COLOR WHEN THEY FADE *@* :) "
  369.                 db      " DO YOU REALIZE THAT YOUR LOOKING AT THE RESULT OF ABOUT 1200 LINES OF CODE?"
  370.                 DB      " NO? OH WELL...  $ "
  371.                 DB      " UNTIL NEXT TIME, ADIOS! *@VLA@vla@VLA@vla@VLA@vla@VLA@vla@*",0
  372.  
  373.         Dist    dw      256 dup (100h)
  374.         DistCnt db      0
  375.         DistCnt2 db     0
  376.         redorblue db    0        
  377.         rbfade  db      32
  378.  
  379.         Detaillevel db  3
  380.  
  381. ;======SUBROUTINES================
  382.  
  383. Calcforrb proc near
  384.         mov     ax,cs
  385.         mov     es,ax
  386.         mov     ds,ax
  387.         mov     bx,80*3
  388.         xor     ah,ah
  389. Fsu2:
  390.         mov     al,[redbluepal+bx]
  391.         sub     al,[paltmp+bx+128*3]
  392.         cmp     al,64
  393.         jb      noneg
  394.         neg     al
  395. noneg:
  396.         shl     ax,2
  397.         mov     [redstep+bx],al
  398.         dec     bx
  399.         jne     fsu2
  400.         mov     di,offset redstep2
  401.         xor     al,al
  402.         mov     cx,80*3
  403.         rep     stosb
  404.         ret
  405. calcforrb endp
  406.  
  407. Fadered proc near
  408.         cld
  409.         mov     ax,cs
  410.         mov     ds,ax
  411.         mov     es,ax
  412.         mov     bx,80*3
  413.         xor     ch,ch
  414. rfloop:
  415.         mov     al,[redstep+bx]
  416.         xor     ah,ah
  417.         mov     cl,[redstep2+bx]
  418.         add     ax,cx
  419.         mov     [redstep2+bx],al
  420.         or      ah,ah
  421.         je      rnoinc
  422.  
  423.         mov     al,[paltmp+bx+128*3]
  424.         cmp     al,[redbluepal+BX]
  425.         je      rnoinc
  426.         jb      rbinc
  427.         dec     paltmp[bx+128*3]
  428.         jmp     rnoinc
  429. rbinc:
  430.         inc     paltmp[bx+128*3]
  431. rnoinc:
  432.         dec     bx
  433.         jne     rFloop
  434.             
  435.         mov     dx,03dah
  436. var:    in      al,dx
  437.         and     al,08
  438.         jz      var
  439.  
  440.         mov     dx,03c8h
  441.         mov     al,0
  442.         out     dx,al
  443.         inc     dx
  444.         mov     cx,128*3+80*3
  445.         mov     si,offset paltmp
  446.         rep     outsb        
  447.         ret
  448. fadered endp
  449.  
  450. DeCompressit proc near
  451.         mov     ax,0a000h
  452.         mov     es,ax
  453.         mov     ax,seg data
  454.         mov     ds,ax
  455.  
  456.         mov     di,40*320+35
  457.         mov     si,776
  458.         add     si,offset vla2cmp
  459.                         
  460.         mov     cx,cs:[xsize]
  461.         mov     bx,cs:[ysize]
  462.         mov     dl,0feh
  463.         push    di
  464. TrAgain:
  465.         lodsb
  466.         cmp     al,dl
  467.         je      decodeloop
  468.         stosb
  469. jumphere:
  470.         dec     cx
  471.         jne     tragain
  472.         mov     cx,cs:[xsize]
  473.         pop     di
  474.         add     di,320
  475.         push    di
  476.         dec     bx
  477.         jne     tragain
  478.         jmp     alldone
  479.  
  480. DECODELOOP:
  481.         lodsb                   ;gets byte to repeat 
  482.         mov     ah,ds:[si]
  483.         inc     si              ;ah=# of times: al= byte to repeat
  484.         stosb
  485.         jmp     dcskip
  486. Bigloop:
  487.         stosb
  488.         dec     ah
  489.         je      jumphere
  490. dcskip:
  491.         dec     cx
  492.         jne     Bigloop
  493.         mov     cx,cs:[xsize]
  494.         pop     di
  495.         add     di,320
  496.         push    di
  497.         dec     bx
  498.         jne     Bigloop
  499.         jmp     alldone
  500. AllDone:
  501.         pop     di
  502.         mov     ax,cS:[overlayseg]
  503.         mov     es,ax
  504.         mov     ax,0a000h
  505.         mov     ds,ax
  506.         mov     si,40h*320
  507.         mov     di,0
  508.         mov     cx,19*320     
  509.         rep     movsw
  510.         ret
  511. deCompressit endp
  512.  
  513. newFadeIn proc near
  514.         cld
  515.         mov     ax,cs
  516.         mov     ds,ax
  517.         mov     es,ax
  518.         mov     bx,768
  519.         xor     ch,ch
  520. Nfiloop:
  521.         mov     al,[palstep+bx]
  522.         xor     ah,ah
  523.         mov     cl,[palstep2+bx]
  524.         add     ax,cx
  525.         mov     [palstep2+bx],al
  526.         or      ah,ah
  527.         je      nnoinc
  528.         mov     al,paltmp[bx]
  529.         cmp     al,pal[BX]
  530.         je      nnoinc
  531.         inc     paltmp[bx]
  532. nnoinc:
  533.         dec     bx
  534.         jne     nFIloop
  535.         
  536. writetopal:
  537.         mov     dx,03dah
  538. vrrr:    in      al,dx
  539.         and     al,08
  540.         jz      vrrr
  541.  
  542.         mov     dx,03c8h
  543.         mov     al,0
  544.         out     dx,al
  545.         inc     dx
  546.         mov     cx,768
  547.         mov     si,offset paltmp
  548.         rep     outsb        
  549.         ret
  550. newFadeIn endp
  551.  
  552. newFadeout proc near
  553.         mov     ax,cs
  554.         mov     ds,ax
  555.         mov     es,ax
  556.         mov     bx,768
  557.         xor     ch,ch
  558. Nfoloop:
  559.         mov     al,[palstep+bx]
  560.         xor     ah,ah
  561.         mov     cl,[palstep2+bx]
  562.         add     ax,cx
  563.         mov     [palstep2+bx],al
  564.         or      ah,ah
  565.         je      nnodec
  566.         cmp     paltmp[Bx],0
  567.         je      nnodec
  568.         dec     paltmp[bx]
  569. nnodec:
  570.         dec     bx
  571.         jne     nFoloop
  572.         jmp     writetopal
  573. newFadeout endp
  574.  
  575.         ;es:di = seg to write to
  576. DisplayText proc near
  577.  
  578.         mov     bx,dx           ;string location
  579. displayloop:
  580.         mov     al,cs:[bx]
  581.         or      al,al
  582.         je      Textdone
  583.  
  584.         CMP     al,1
  585.         jne     ncsc
  586.         inc     bx
  587.         mov     al,cs:[bx]
  588.         mov     cs:[color],al
  589.         inc     bx
  590.         jmp     displayloop
  591. ncsc:
  592.         sub     al,' '
  593.         cmp     al,cS:[numchars]
  594.         ja      skipit
  595.  
  596.         call    putchar         ;al= frame # es:di is dest
  597.         mov     cl,cs:[sizex]
  598.         xor     ch,ch
  599.         add     di,cx
  600. skipit:
  601.         inc     bx
  602.         jmp     displayloop
  603. TextDone:
  604.         ret
  605. DisplayText endp
  606.  
  607.         ;Destroys AX, DX, CX
  608. PutChar proc near
  609.         push    ds
  610.         push    si
  611.         push    di
  612.  
  613.         xor     ah,ah
  614.         mov     dx,cs:[xysize]
  615.         mul     dx
  616.         mov     si,ax
  617.         add     si,9
  618.         mov     ax,seg data
  619.         mov     ds,ax
  620.         mov     cl,cs:[sizex]
  621.         mov     ch,cs:[sizey]
  622.         push    di
  623. putloop:
  624.         lodsb
  625.         or      al,al
  626.         je      @@s
  627.         add     al,cs:[color]
  628.         stosb
  629.         jmp     @@d
  630. @@s:
  631.         inc     di
  632. @@d:
  633.         dec     cl
  634.         jne     putloop
  635.         mov     cl,cs:[sizex]
  636.         pop     di        
  637.         add     di,320
  638.         push    di
  639.         dec     ch
  640.         jne     putloop
  641.  
  642.         pop     ax
  643.         pop     di
  644.         pop     si
  645.         pop     ds
  646.         ret
  647. PutChar endp
  648.  
  649.                         ;[xsize] and [ysize] must be set (of source) <255
  650.                         ;bp is dist upon entry
  651. Sizer   proc near       ;needs Ds:si set up to source ES:di to dest
  652.         xor     cx,cx
  653.         xor     ax,ax
  654.         xor     dh,dh
  655.         add     si,9
  656.         push    si
  657.         push    di      ;make a copy so we know where to start
  658.         cmp     cs:[rightside],1
  659.         jne     sizeloop
  660.         jmp     sizeloop2
  661. sizeloop:
  662.         push    ax
  663.         lodsb
  664.         or      al,al
  665.         je      @@s
  666.         ADD     al,cs:[color]
  667.         stosb
  668.         jmp     @@d
  669. @@s:
  670.         inc     di
  671. @@d:
  672.         pop     ax
  673.         dec     si
  674.         xor     ah,ah
  675.         add     ax,bp
  676.         mov     dl,ah
  677.         or      dl,dl
  678.         je      Sizeloop        ;if the change is zero, why bother to add it?
  679.  
  680.         add     si,dx           ;add change to source
  681.         add     cl,dl           ;cl counts xpos ch counts ypos (in source)
  682.         cmp     cl,cs:[sizex]
  683.         jb      sizeloop
  684.  
  685.         xor     cl,cl           ;we've just completed a line- on to the next
  686.         xor     al,al
  687.         pop     di
  688.         pop     si
  689.         add     di,320
  690.         cmp     di,68*320
  691.         ja      sizedone
  692.  
  693.         mov     al,cs:[sizex]   
  694.         xor     bh,bh
  695.         add     bx,bp           ;see how much to increase si
  696.         mov     ah,bh
  697.         add     ch,bh           ;inc ypos counter
  698.         mul     ah              ;multilpy by xsize   
  699.         add     si,ax           ;and add
  700.         xor     ax,ax
  701.  
  702.         cmp     ch,cs:[sizey]   
  703.         jae     sizedone
  704.  
  705.         push    si
  706.         push    di              ;increase to next rows values
  707.         jmp     sizeloop
  708. sizedone:        
  709.         ret
  710. sizeloop2:
  711.         push    ax
  712.         cmp     byte ptr es:[di],0
  713.         ;mov     al,es:[di]
  714.         ;or      al,al
  715.         jne     @@s2
  716.         lodsb
  717.         or      al,al
  718.         je      @@na
  719.         add     al,cs:[color]
  720.         stosb
  721.         jmp     @@d2
  722. @@s2:
  723.         inc     si
  724. @@na:
  725.         inc     di
  726. @@d2:
  727.         pop     ax
  728.         dec     si
  729.         xor     ah,ah
  730.         add     ax,bp
  731.         mov     dl,ah
  732.         or      dl,dl
  733.         je      Sizeloop2        ;if the change is zero, why bother to add it?
  734.  
  735.         add     si,dx           ;add change to source
  736.         add     cl,dl           ;cl counts xpos ch counts ypos (in source)
  737.         cmp     cl,cs:[sizex]
  738.         jb      sizeloop2
  739.  
  740.         xor     cl,cl           ;we've just completed a line- on to the next
  741.         xor     al,al
  742.         pop     di
  743.         pop     si
  744.         add     di,320
  745.  
  746.         mov     al,cs:[sizex]   
  747.         xor     bh,bh
  748.         add     bx,bp           ;see how much to increase si
  749.         mov     ah,bh
  750.         add     ch,bh           ;inc ypos counter
  751.         mul     ah              ;multilpy by xsize   
  752.         add     si,ax           ;and add
  753.         xor     ax,ax
  754.         cmp     di,68*320
  755.         ja      sizedone2
  756.         
  757.         cmp     ch,cs:[sizey]   
  758.         jae     sizedone2
  759.  
  760.         push    si
  761.         push    di              ;increase to next rows values
  762.         jmp     sizeloop2
  763. sizedone2:        
  764.         ret
  765. sizer endp
  766.  
  767.         
  768. SetUpDist proc near
  769.         xor     bx,bx
  770.         mov     dh,0
  771.         mov     dl,255
  772.         mov     ax,cs:[distance]
  773.         mov     cx,cs:[velocity]
  774.         
  775. BigSetUp:
  776.         mov     bl,dl
  777.         xor     bh,bh
  778.         shl     bx,1
  779.  
  780.         add     ax,cx
  781.         add     cx,cs:[acceleration]
  782.         cmp     ax,cs:[opdist]
  783.         jbe     movok
  784.         sub     cx,cs:[acceleration]
  785.         sub     cx,cs:[acceleration]
  786. Movok:
  787.         mov     cs:[dist+bx],ax
  788.         inc     dl
  789.         jne     BigSetup
  790.         or      dh,dh
  791.         jne     kkjo
  792.         inc     dh
  793.         jmp     bigsetup
  794. kkjo:
  795.         mov     cs:[distance],ax
  796.         mov     cs:[velocity],cx
  797.         mov     cs:[distCnt],255
  798.         ret
  799. SetUpDist endp  
  800.  
  801. scroll3d proc near
  802.         mov     ax,cs:[backupseg]
  803.         mov     es,ax
  804.         xor     ax,ax
  805.         xor     di,di
  806.         mov     cx,32000
  807.         rep     stosw
  808.         
  809.         mov     ax,seg data
  810.         mov     ds,ax
  811.         mov     ax,cS:[Backupseg]
  812.         mov     es,ax
  813.  
  814.         mov     cs:[textlength],MESSAGEWIDTH
  815.  
  816.         mov     ax,cs:[letstart]
  817.         mov     cs:[count],ax
  818.  
  819.         mov     al,cs:[distcnt]
  820.         mov     cs:[distcnt2],al
  821.  
  822.         mov     cx,cs:[xstart]
  823.         mov     al,cs:[scrollspeed]
  824.         xor     ah,ah
  825.         sub     cs:[xstart],ax
  826.         push    cx
  827.  
  828.         add     cs:[scrollcount],al
  829.         mov     cl,cs:[scrollcount]
  830.         cmp     cl,cs:[sizex]
  831.         jb      Disploop
  832.  
  833.         mov     cs:[scrollcount],0
  834.         mov     cS:[xstart],-185
  835.         inc     cs:[letstart]
  836.         mov     bx,cs:[letstart]
  837.         mov     al,cs:[textmsg+bx]
  838.         or      al,al
  839.         jne     disploop
  840.         mov     cs:[letstart],0
  841. Disploop:        
  842.         mov     bx,cs:[count]
  843.         inc     cS:[count]
  844.         mov     al,cs:[textmsg+bx]
  845.         or      al,al
  846.         jne     notanend
  847.         mov     cs:[count],0
  848.         jmp     disploop
  849. NotAnend:
  850.         mov     cs:[color],CAPSCOLOR
  851.         cmp     al,'a'
  852.         jb      notcolor
  853.         sub     al,32
  854.         mov     cs:[color],LOWERCOLOR
  855. Notcolor:
  856.         dec     cs:[textlength]
  857.         jne     notover
  858.         pop     cx
  859.         jmp     AlldoneHere
  860. NotOver:
  861.         xor     ah,ah
  862.         sub     al,32
  863.         mov     dx,cs:[xysize]
  864.         mul     dx
  865.         mov     si,ax
  866.  
  867.         pop     ax
  868.         mov     dl,cs:[sizex]
  869.         xor     dh,dh
  870.         add     ax,dx
  871.         push    ax
  872.         mov     cs:[rightside],1
  873.         cmp     ax,0700h
  874.         jb      notoveryet
  875.         mov     cs:[rightside],0
  876. NotOverYet:
  877.         inc     cs:[distcnt2]
  878.         mov     bl,cs:[distcnt2]
  879.         xor     bh,bh
  880.         shl     bx,1
  881.         mov     bp,cs:[dist+bx]
  882.         
  883.         push    -41              ;store ypos WAS -40
  884.  
  885.         mov     dx,100h         ;xpos*100h
  886.         imul    dx
  887.         idiv    bp              ;/distance
  888.         mov     cx,ax
  889.         add     cx,CENTERX      ;+160
  890.         mov     ah,cs:[sizex]
  891.         xor     al,al
  892.         xor     dx,dx
  893.         mov     bx,bp
  894.         shl     bx,1
  895.         div     bx
  896.         sub     cx,ax           ;-xsize*100h/2*distance
  897.         cmp     cx,310
  898.         jb      @@c
  899.         pop     ax
  900.         jmp     disploop
  901. @@c:
  902.         pop     ax              ;ax has ypos now
  903.         push    cx              ;save result from above
  904.         
  905.         mov     dx,100h         ;ypos*100h
  906.         imul    dx
  907.         idiv    bp              ;/distance
  908.         mov     cx,ax
  909.         add     cx,CENTERY      ;+100
  910.         mov     ah,cs:[sizey]
  911.         xor     al,al
  912.         xor     dx,dx
  913.         mov     bx,bp
  914.         shl     bx,1
  915.         div     bx
  916.         sub     cx,ax           ;-ysize*100h/2*distance
  917.         
  918.         imul    di,cx,320
  919.         pop     cx              ;bring back screenxpos
  920.         add     di,cx   
  921.  
  922.         call    sizer
  923.         jmp     Disploop
  924.  
  925. AllDoneHere:
  926.         mov     ax,cs:[distance]
  927.         mov     bx,cs:[velocity]
  928.         mov     cx,cs:[acceleration]
  929.         add     ax,bx
  930.         add     bx,cx
  931.         cmp     ax,cs:[opdist]
  932.         jbe     @@m
  933.         sub     bx,cx
  934.         sub     bx,cx
  935. @@M:
  936.         mov     cs:[velocity],bx
  937.         inc     cs:[distcnt]
  938.         mov     bl,cs:[distcnt]
  939.         xor     bh,bh
  940.         shl     bx,1
  941.         mov     cs:[distance],ax
  942.         mov     cs:[dist+bx],ax
  943.  
  944.         mov     ax,cs:[backupseg]
  945.         mov     ds,ax
  946.         mov     ax,0a000h
  947.         mov     es,ax
  948.         mov     bx,21           ;was 23
  949.  
  950.         mov     si,47*320+20            ;was 45 & 163 DRAEDEN
  951.         mov     di,165*320+20
  952. Copyloop:
  953.         mov     cx,280/2
  954.         rep     movsw
  955.         add     si,40
  956.         add     di,40
  957.         dec     bx
  958.         jne     copyloop
  959.  
  960.         mov     cx,280/2
  961.         mov     al,3
  962.         mov     ah,al
  963.         rep     stosw
  964.         add     di,40
  965.         mov     al,5
  966.         mov     ah,al
  967.         mov     cx,280/2
  968.         rep     stosw
  969.         
  970.         add     di,40
  971.         mov     bx,15
  972. Copyloop2:
  973.         mov     cx,280/2
  974.         mov     al,cs:[detaillevel]
  975.         or      al,al
  976.         je      Donescroll3d3d
  977.         cmp     al,3
  978.         jb      notdarkened
  979. Copylp3:
  980.         lodsw
  981.         or      al,al
  982.         je      noal
  983.         inc     al
  984. noal:
  985.         or      ah,ah
  986.         je      noah
  987.         inc     ah
  988. noah:
  989.         stosw
  990.         loop    copylp3
  991.         ;rep     movsw
  992.         sub     si,280+320*2
  993.         add     di,40
  994.         dec     bx
  995.         jne     copyloop2
  996.         ret
  997. NotDarkened:
  998.         mov     cx,280/2
  999.         rep     movsw
  1000.         sub     si,280+320*2
  1001.         add     di,40
  1002.         dec     bx
  1003.         jne     notdarkened
  1004.  
  1005. donescroll3d3d:
  1006.         ret
  1007. Scroll3d endp
  1008.  
  1009. Calcforfade proc near
  1010.         mov     ax,cs
  1011.         mov     es,ax
  1012.         mov     ds,ax
  1013.         mov     si,offset pal
  1014.         mov     di,offset palstep
  1015.         mov     cx,768
  1016.         xor     ah,ah
  1017. Fsu:
  1018.         lodsb
  1019.         shl     ax,2
  1020.         stosb
  1021.         dec     cx
  1022.         jne     fsu
  1023.         mov     di,offset palstep2
  1024.         mov     cx,768/2
  1025.         xor     ax,ax
  1026.         rep     stosw
  1027.         ret
  1028. calcforfade endp
  1029.  
  1030. ;======- End Subs -======
  1031.  
  1032. Main:
  1033.         mov     ax,cs
  1034.         mov     ds,ax
  1035.         mov     es,ax
  1036.         mov     dx,offset instruct
  1037.         mov     ah,9
  1038.         int     21h
  1039.  
  1040.         mov     dx,offset pal
  1041.         mov     ax,1017h                ; read palette
  1042.         mov     bx,0                    
  1043.         mov     cx,256                  
  1044.         int     10h                     
  1045.         mov     si,offset pal
  1046.         mov     di,offset paltmp
  1047.         mov     cx,768/2
  1048.         rep     movsw
  1049.         call    calcforfade
  1050.         mov     cs:[fadestep],64
  1051. foo1:
  1052.         mov     dx,03dah
  1053. vrr:    in      al,dx
  1054.         and     al,08
  1055.         jz      vrr
  1056.         call    newfadeout
  1057.         dec     cs:[fadestep]
  1058.         jne     foo1
  1059.  
  1060.         MOV     ax,cs
  1061.         mov     es,ax
  1062.         mov     ax,seg data
  1063.         mov     ds,ax
  1064.  
  1065.         mov     al,ds:[6]
  1066.         mov     cs:[sizex],al
  1067.         mov     ah,ds:[7]
  1068.         mov     cs:[sizey],ah
  1069.         mul     ah
  1070.         mov     cs:[xysize],ax
  1071.         mov     al,ds:[8]
  1072.         mov     cs:[numchars],al
  1073.  
  1074.         mov     si,offset vla2cmp + 8
  1075.         mov     di,offset pal
  1076.         mov     cx,768/2
  1077.         rep     movsw
  1078.         call    calcforfade
  1079.  
  1080.         mov     ax,es
  1081.         mov     ds,ax
  1082.  
  1083.         mov     ax,0013h
  1084.         int     10h
  1085.  
  1086.         mov     ax,cs
  1087.         mov     ds,ax
  1088.         mov     es,ax
  1089.  
  1090.         mov     si,offset pal
  1091.         mov     di,offset pal+128*3
  1092.         mov     cx,16*3/2
  1093.         rep     movsw
  1094.  
  1095.         mov     dx,offset paltmp
  1096.         mov     ax,1012h                ; WRITE palette (all zeros)
  1097.         mov     bx,0                    
  1098.         mov     cx,256                  
  1099.         int     10h                     
  1100.         push    ds
  1101.         push    es
  1102.         call    decompressit 
  1103.         pop     es
  1104.         pop     ds
  1105.  
  1106.  
  1107.         call    setupdist
  1108.         mov     cs:[fadestep],64
  1109. l1fi:        
  1110. ;        mov     dx,03dah
  1111. ;vr1:    in      al,dx
  1112. ;        and     al,08
  1113. ;        jz      vr1
  1114.         
  1115.         call    newfadein
  1116.         call    scroll3d
  1117.         dec     cs:[fadestep]
  1118.         jne     l1fi
  1119.         mov     cs:[fadestep],64
  1120.         
  1121.         mov     ax,cs
  1122.         mov     ds,ax
  1123.         mov     es,ax
  1124.         
  1125.         mov     bx,0
  1126. seblue:
  1127.         mov     al,[pal+128*3+bx]
  1128.         mov     ah,[pal+128*3+bx+1]
  1129.         mov     dl,[pal+128*3+bx+2]
  1130.         mov     [redbluepal+bx+2],al
  1131.         mov     [redbluepal+bx+1],ah
  1132.         mov     [redbluepal+bx],dl
  1133.         add     bx,3
  1134.         cmp     bx,80*3+1
  1135.         jb      seblue
  1136.  
  1137.         call    calcforrb
  1138.         mov     cs:[rbfade],64
  1139.  
  1140.         mov     ax,cs:[textseg]
  1141.         mov     es,ax
  1142.         xor     di,di
  1143.         xor     ax,ax
  1144.         mov     cx,320*20/2
  1145.         rep     stosw
  1146.  
  1147.  
  1148. mlp:
  1149.         call    scroll3d
  1150.         cmp     cs:[specialtextflag],0
  1151.         jne     continuespecial
  1152.         DEC     cS:[msgpause]
  1153.         je      newmessages
  1154.         jmp     nonewmessages
  1155. newmessages:
  1156.         mov     cs:[msgpause],MWAIT
  1157.         mov     al,cS:[setvalue]
  1158.         mov     cs:[specialtextflag],al
  1159.         jmp     nonewmessages
  1160. Continuespecial:
  1161.         mov     ax,cS:[overlayseg]
  1162.         mov     ds,ax
  1163.         mov     ax,cs:[textoverlayseg]
  1164.         mov     es,ax
  1165.         mov     di,0
  1166.         mov     si,0
  1167.         mov     cx,19*160
  1168.         rep     movsw
  1169.         cld
  1170.         mov     ax,cs:[textseg]
  1171.         mov     ds,ax
  1172.  
  1173.         mov     bl,cS:[specialtextflag]
  1174.         dec     bl
  1175.         mov     al,19
  1176.         mul     bl
  1177.         mov     bx,ax
  1178.         add     bx,cs:[curtextlineoffset]
  1179.         mov     dx,19
  1180.         xor     di,di
  1181. copytextloop:
  1182.         mov     al,cs:[bx]
  1183.         or      al,al
  1184.         jne     thereissomething
  1185.         add     di,320
  1186.         jmp     donetextloop
  1187. Thereissomething:
  1188.         xor     ah,ah
  1189.         imul    si,ax,320
  1190.         mov     cx,320
  1191. hereboy:
  1192.         lodsb
  1193.         or      al,al
  1194.         je      downhere
  1195.         stosb
  1196.         dec     cx
  1197.         jne     hereboy
  1198.         jmp     donetextloop
  1199. downhere:
  1200.         inc     di
  1201.         dec     cx
  1202.         jne     hereboy
  1203.  
  1204. Donetextloop:
  1205.         inc     bx
  1206.         dec     dx
  1207.         jne     copytextloop
  1208.  
  1209.         mov     ax,0a000h
  1210.         mov     es,ax
  1211.         mov     ax,cs:[textoverlayseg]
  1212.         mov     ds,ax
  1213.         mov     di,40h*320
  1214.         xor     si,si
  1215.         mov     cx,19*320/2
  1216.         rep     movsw
  1217.         
  1218.         dec     cs:[specialtextflag]
  1219.         jne     notdoneyet
  1220.         inc     cS:[curtextline]
  1221.         cmp     cS:[curtextline],NUMTEXTLINES
  1222.         jb      textlinesok
  1223.         mov     cs:[curtextline],0
  1224. Textlinesok:
  1225.         mov     bx,cs:[curtextline]
  1226.         shl     bx,1
  1227.         mov     si,cs:[textlinesoffset+bx]
  1228.         mov     al,cs:[si]
  1229.         mov     ah,cs:[si+1]
  1230.         add     si,2
  1231.         mov     cs:[curtextlineoffset],si
  1232.         mov     cs:[cmpvalue],ah
  1233.         mov     cS:[setvalue],al
  1234.         jmp     nonewmessages
  1235. notdoneyet:
  1236.         mov     al,cS:[cmpvalue]
  1237.         cmp     cS:[specialtextflag],al
  1238.         jne     nonewmessages
  1239.  
  1240.         mov     bl,cs:[msgcount]      
  1241.         xor     bh,bh
  1242.         shl     bx,1
  1243.         mov     dx,cS:[msgoffsets+bx]
  1244.         mov     ax,cs:[textseg]
  1245.         mov     es,ax
  1246.         xor     di,di
  1247.         xor     ax,ax
  1248.         mov     cx,320*20/2
  1249.         rep     stosw
  1250.         mov     di,dx
  1251.         mov     bl,cs:[di]
  1252.         xor     bh,bh
  1253.         mov     di,bx
  1254.         inc     dx
  1255.         call    displayText
  1256.         inc     cs:[msgcount]
  1257.         mov     al,cs:[nummsg]
  1258.         cmp     cs:[msgcount],al
  1259.         jb      nonewmessages
  1260.         mov     cS:[msgcount],0
  1261. nonewmessages:
  1262.         cmp     cs:[detaillevel],2
  1263.         jb      nonewfade
  1264.         call    fadered
  1265.         dec     cS:[rbfade]
  1266.         jne     nonewfade
  1267.         mov     cs:[rbfade],64          ;NOTE ! WAS 64
  1268.         cmp     cs:[redorblue],0
  1269.         je      dorednow
  1270.         mov     ax,cs
  1271.         mov     ds,ax
  1272.         mov     es,ax
  1273.         
  1274.         mov     bx,0
  1275. settblue:
  1276.         mov     al,[pal+128*3+bx]
  1277.         mov     ah,[pal+128*3+bx+1]
  1278.         mov     dl,[pal+128*3+bx+2]
  1279.         mov     [redbluepal+bx+2],al
  1280.         mov     [redbluepal+bx+1],ah
  1281.         mov     [redbluepal+bx],dl
  1282.         add     bx,3
  1283.         cmp     bx,80*3+1
  1284.         jb      settblue
  1285.  
  1286.         mov     cs:[redorblue],0
  1287.         jmp     skipred
  1288. dorednow:
  1289.         mov     ax,cs
  1290.         mov     ds,ax
  1291.         mov     es,ax
  1292.         mov     di,offset redbluepal
  1293.         mov     si,offset pal
  1294.         mov     cx,16*3
  1295.         rep     movsb
  1296.         
  1297.         mov     si,offset pal +144*3
  1298.         mov     cx,64*3
  1299.         rep     movsb
  1300.  
  1301.         mov     cS:[redorblue],1
  1302. skipred:
  1303.         call    calcforrb
  1304. Nonewfade:
  1305.         mov     ah,1
  1306.         int     16h
  1307.         jnz      nomlp
  1308.         jmp     mlp
  1309. Nomlp:
  1310.         xor     ah,ah
  1311.         int     16h
  1312.         cmp     al," "
  1313.         jne     notspacebar
  1314.         inc     cs:[letstart]
  1315.         jmp     mlp
  1316. Notspacebar:
  1317.         cmp     al,13
  1318.         jne     notenter
  1319.         mov     cs:[msgpause],5
  1320.         jmp     mlp
  1321. NotEnter:
  1322.         cmp     al,"+"
  1323.         jne     notplus
  1324.         inc     cs:[scrollspeed]
  1325.         mov     al,cs:[sizex]
  1326.         cmp     cs:[scrollspeed],al
  1327.         jb      nottoobig
  1328.         dec     cs:[scrollspeed]
  1329. nottoobig:
  1330.         jmp     mlp
  1331. Notplus:
  1332.         cmp     al,"-"
  1333.         jne     notminus
  1334.         cmp     cs:[scrollspeed],0
  1335.         je      atzero
  1336.         dec     cs:[scrollspeed]
  1337. Atzero:
  1338.         jmp     mlp
  1339.  
  1340. Notminus:
  1341.         cmp     al,"1"
  1342.         jb      folp1
  1343.         cmp     al,"4"
  1344.         ja      folp1
  1345.         sub     al,"1"
  1346.         mov     cs:[detaillevel],al
  1347.         cmp     al,0
  1348.         je      noa1
  1349.         jmp     mlp
  1350. noa1:
  1351.         push    es
  1352.         mov     ax,0a000h
  1353.         mov     es,ax
  1354.         mov     di,CLEARLINE*320
  1355.         mov     cx,(200-CLEARLINE)*320/2
  1356.         xor     ax,ax
  1357.         rep     stosw
  1358.         pop     es
  1359.         jmp     mlp
  1360. folp1:
  1361.         mov     ax,cs
  1362.         mov     ds,ax
  1363.         mov     es,ax
  1364.         mov     si,offset paltmp +128*3
  1365.         mov     di,offset pal +128*3
  1366.         mov     cx,80*3
  1367.         rep     movsb
  1368.  
  1369.         call    calcforfade
  1370. folp:
  1371. ;        mov     dx,03dah
  1372. ;vr2:    in      al,dx
  1373. ;        and     al,08
  1374. ;        jz      vr2
  1375.  
  1376.         call    newfadeout
  1377.         call    scroll3d
  1378.         dec     cs:[fadestep]
  1379.         jne     folp
  1380. ByeBye:
  1381. byebye2:
  1382.         mov     ax,0003h
  1383.         int     10h
  1384.         mov     ax,4c00h
  1385.         int     21h
  1386.  
  1387. code ends
  1388.         end start 
  1389.